<?php
namespace Home\Controller;
use Think\Controller;
Class OrderController extends Controller
{
	  //我的订单 1购买 2交易
    public function home_order()
    {
        $order_type = 1;//intval(I("post.order_type"));

        $token = 2;//trim(I("post."));

        $release_id = trim(I("get.id"));

        $user_token['user_token'] = $token;

        $info = D("Index")->get_user_one_info($user_token);

        if (empty($info)) {

            $this->error("请登录!", U("redirect_login"));
        }
        $condition["order_user_id"] = $info['user_id'];

        $condition["order_type"]   = 1;

        //判断订单类型
        if($order_type == 2) {
            $condition["order_type"]   = 2;
        }

        $condition["order_status"] = 1;

        $condition["order_state"]  = 1;

        $get_order_info = D("Order")->get_order_info($condition);

        print_R($get_order_info);die;
        $this->assign("get_order_info",$get_order_info);

        $this->display();
    }

    //token过期自动跳转至登陆页面
    public function redirect_login()
    {
        $this->display("Index/login");
    }
}
?>


